package com.yu.crm.domain.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.annotation.JSONType;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author donnie-bin
 * @since 2019-06-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@JSONType(orders = {"id"})
public class CrmUser implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键", required = false)
    @TableId(value = "id", type = IdType.ID_WORKER)
    private Long id;

    @ApiModelProperty(value = "用户ID", required = false)
    @TableField("user_id")
    private String userId;

    @ApiModelProperty(value = "用户微信OpenId", required = false)
    @TableField("user_wx_open_id")
    private String userWxOpenId;

    @ApiModelProperty(value = "所属企业微信ID", required = false)
    @TableField("user_wx_cp_id")
    private String userWxCpId;

    @ApiModelProperty(value = "用户账号ID", required = false)
    @TableField("user_account_id")
    private String userAccountId;

    @ApiModelProperty(value = "用户账号密码", required = false)
    @TableField("user_account_pwd")
    @JSONField(serialize = false)
    private String userAccountPwd;

    @ApiModelProperty(value = "用户姓名", required = false)
    @TableField("user_name")
    private String userName;

    @ApiModelProperty(value = "用户人脸特征图片URL", required = false)
    @TableField("user_face_url")
    private String userFaceUrl;

    @ApiModelProperty(value = "用户人脸特征", required = false)
    @TableField("certificate_eigen")
    private byte[] certificateEigen;


    @ApiModelProperty(value = "用户头像URL", required = false)
    @TableField("user_avatar_url")
    private String userAvatarUrl;

    @ApiModelProperty(value = "用户性别 user_sex", required = false)
    @TableField("user_sex")
    private Integer userSex;

    @ApiModelProperty(value = "用户出生日期 yyyy-MM-dd", required = false)
    @TableField("user_birthday")
    private String userBirthday;

    @ApiModelProperty(value = "用户认证手机号", required = false)
    @TableField("user_phone")
    private String userPhone;

    @ApiModelProperty(value = "用户认证邮箱", required = false)
    @TableField("user_email")
    private String userEmail;

    @ApiModelProperty(value = "用户证件类型 user_auth_cert_type", required = false)
    @TableField("user_cert_type")
    private Integer userCertType;

    @ApiModelProperty(value = "用户证件号", required = false)
    @TableField("user_cert_id")
    private String userCertId;

    @ApiModelProperty(value = "用户个性签名", required = false)
    @TableField("user_signature")
    private String userSignature;

    @ApiModelProperty(value = "用户家庭地址", required = false)
    @TableField("user_address")
    private String userAddress;

    @ApiModelProperty(value = "用户状态 user_status", required = false)
    @TableField("user_status")
    private Integer userStatus;

    @ApiModelProperty(value = "创建时间", required = false)
    @TableField("gmt_create")
    private LocalDateTime gmtCreate;

    @ApiModelProperty(value = "修改时间", required = false)
    @TableField("gmt_modified")
    private LocalDateTime gmtModified;

    @ApiModelProperty(value = "是否已删除 yes_no", required = false)
    @TableField("is_deleted")
    private Integer isDeleted;


    @TableField(exist = false)
    private String memberNo;

    @ApiModelProperty(value = "登录token", required = false)
    @TableField(exist = false)
    private String loginToken;

    @ApiModelProperty(value = "部门名称", required = false)
    @TableField(exist = false)
    private String departmentName;

    @ApiModelProperty(value = "职位名称", required = false)
    @TableField(exist = false)
    private String positionName;

    @ApiModelProperty(value = "新密码", required = false)
    @TableField(exist = false)
    private String newUserAccountPwd;

    /**
     * 角色名称
     */
    @TableField(exist = false)
    private String roleName;

  /**
     * 角色名称
     */
    @TableField(exist = false)
    private Long roleId;

    /**
     * 权限id集合
     */
    @TableField(exist = false)
    private List<HashMap<String,Object>> roles;

    @TableField(exist = false)
    private List<CrmRole> roleList;

    /**
     * 登录方式，1：账户密码，2：手机号验证码
     */
    @NotNull(message = "登录方式，1：账户密码，2：手机号验证码")
    @TableField(exist = false)
    private Integer loginType;

    /**
     * 附加验证码
     */
    @TableField(exist = false)
    private String loginExtraCode;
}
